package com.hktf.moedokilock.adapter;

import android.text.TextUtils;
import android.view.View;
import android.widget.ImageView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseMultiItemQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.hktf.corelib.utils.CommUtils;
import com.hktf.moedokilock.R;
import com.hktf.moedokilock.bean.MainItem;
import com.hktf.moedokilock.bean.WallpaperItem;
import com.hktf.uilib.utils.ImageUtilNew;

import java.util.List;

/**
 * @包名称： com.cdz.bluetooth.adapter
 * @类名： BluetoothViewAdapter
 * @创建人： 陈大专
 * @时间： 2021/08/17 14:06
 * @描述：
 */
public class WallpaperItemAdapter extends BaseMultiItemQuickAdapter<WallpaperItem, BaseViewHolder> {
    public WallpaperItemAdapter(@Nullable List<WallpaperItem> data) {
        super(data);
        addItemType(0, R.layout.wallpaper_item);
        addItemType(2,R.layout.tab_item_new);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder helper, WallpaperItem item) {


        helper.setImageResource(R.id.iv_check, item.isChecked()?R.drawable.cb_checked:R.drawable.cb_normal);
        helper.setVisible(R.id.rl_checked,item.isChecked());
        helper.addOnClickListener(R.id.fl_check,R.id.fl_delete);
        if (item.getItemType()==2) {

        }else {
            ImageView iv = helper.getView(R.id.iv);
            ImageUtilNew.loadWithCorner(iv,item.getResId(),8);
        }

    }
}
